widget: Only warn about missing allocation if G_ENABLE_DEBUG
authorTimm Bäder <mail@baedert.org>
Wed, 14 Sep 2016 22:06:54 +0000 (18:06 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 14 Sep 2016 22:06:54 +0000 (18:06 -0400)
Not all occurrences of this warning can be fixed today, so put it behind
a G_ENABLE_DEBUG flag since it still shows legitimate problems even if
some of them are false positives.

gtk/gtkwidget.c

index 4c1d798e26f6c62ebc9c14b6fb4f5743d0c7823e..017bbbed53c6ffee54f2b20b93b111a2df5f6f0f 100644 (file)
@@ -6998,8 +6998,10 @@ gtk_widget_draw_internal (GtkWidget *widget,
       if (push_group)
         cairo_push_group (cr);
 
+#ifdef G_ENABLE_DEBUG
       if (_gtk_widget_get_alloc_needed (widget))
         g_warning ("%s %p is drawn without a current allocation. This should not happen.", G_OBJECT_TYPE_NAME (widget), widget);
+#endif
 
       if (g_signal_has_handler_pending (widget, widget_signals[DRAW], 0, FALSE))
         {